package com.example.controller;

import com.example.transport.TransportService;
import com.exmaple.dto.RpcResponse;
import com.exmaple.dto.RpcRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("job")
@RestController
public class JobHandlerController {

    @Resource
    private TransportService transportService;

    @PostMapping("executor")
    public RpcResponse executor(@RequestBody RpcRequest rpcRequest) {
        return transportService.handler(rpcRequest);
    }
}
